package four.book.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import four.book.biz.CommitBiz;
import four.book.dao.Comment2Mapper;
import four.book.entity.Book;
import four.book.entity.Comment2;

/**
@author 鏉庡織
@version 1.0
<p>鏃ユ湡锛�018骞�2鏈�7鏃�涓嬪崍8:09:18</p>
*/
@Service
public class CommitBizImpl implements CommitBiz {

	@Resource
	private Comment2Mapper cm;
	public int add(Comment2 commit) {
		int i=cm.insert(commit);
		return i;
	}

	public List<Comment2> selectComment2(Book book) {
		List<Comment2> ct=cm.selectcomment(book.getBookIsbn());
		return ct;
	}

	public Comment2 selectComment(Comment2 commit) {
		Comment2 ct=cm.selectByPrimaryKey(commit.getComId());
		return ct;
	}

	public int updateComment2(Comment2 commit) {
		int i=cm.updateByPrimaryKey(commit);
		return i;
	}

	public int delectComment2(Comment2 commit) {
		int i=cm.deleteByPrimaryKey(commit.getComId());
		return i;
	}

}
